#include <iostream>
#include <string>

using namespace std;

/*
                        public      protected       private
public      公共继承        √           √               x
protected   保护继承        √           √               x
private     私有继承        
*/

class person
{
public:
    string name;    // 姓名
protected:
    string sex;     // 性别
private:
    int age;        // 年龄

public:
    person(string name, int age , string  sex)
        : name(name), age(age) ,sex(sex)
    {
        cout << "父类有参构造" << endl;
    }
    person()
    {
        name = "未设置姓名";
        age = -1;
        sex = "沃尔玛塑料袋";
        cout << "父类无参构造" << endl;
    }

    ~person()
    {
        cout << "我是父类的析构" << endl;
    }
};


class student : private person
{
public:
    int id;

public:
    // 有参构造

    // 调用父类的有参构造函数
    student(string name, string sex , int age, int id)
        : person(name, age , sex), id(id)
    {
        cout << "子类有参构造" << endl;
    }

    student()
    {
        cout << "子类无参构造" << endl;
    }
    ~student()
    {
        cout << "我是子类的析构" << endl;
    }

public:
    void show_date()
    {
        
    }
};


class son : private student
{
private:
public:
    son(/* args */)
    {
        student::id = 10;
    }
    ~son()
    {

    }
};



int main(int argc, char const *argv[])
{
    son s;



    while (1)
    {
        /* code */
    }

    return 0;
}

